fix: parse arguments to CardService.reorder correctly to int#7154
Conversation
245dc06 to
2116bb8
Compare
grnd-alt
left a comment
There was a problem hiding this comment.
thanks a lot for your first contribution 🔥
I think the type definitions in cardService should definitely be there.
The type coercion though is only done in non strict mode (which is not set, but still) so I think we should keep the explicit type conversion we have in CardController right now, as it also doesn't have any downside afaik
2116bb8 to
3a24dc4
Compare
Signed-off-by: Viktor Diezel <viktor.diezel@posteo.de>
3a24dc4 to
eee35ac
Compare
Thank you! |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
/backport to stable31 |
|
/backport to stable32 |
Summary
This correctly casts cardId and stackId (and order, just for consistency) into
integersin CardService.reorder, no matter where CardService.reorder is called from. This fixes the call from CardApiController.reorder, because it passes cardId and stackId as strings. I've seen other places where there is no type cast applied, but it seems it is not an issue most of the time when no identity operator===or!==is used. Reorder does use it, so that is why it broke.The type casting currently is a little bit inconsistent: There is everything from relying on php's implicit type casts from type defs in function parameters, to explicit type casting or none at all, but I was too afraid to touch it, as it might break things. So I kept my change minimal.
Tested this from the native client by modifying the URL in CardApi.reorder:
Checklist